﻿using System;

namespace HW_c1
{
    class Array
    {
        public int[] arr;

        public Array(int[] arr)
        {
            this.arr = arr;
        }

        public void calculate()
        {
            int Max = arr[0];
            int Min = arr[0];
            int sum = 0;
            int avg = 0;
            for (int i = 0; i < arr.Length; i++) { 
                if(arr[i] > Max)
                {
                    Max = arr[i];
                }
                if (arr[i] < Min)
                {
                    Min = arr[i];
                }
                sum += arr[i];
            }
            avg = sum / arr.Length;

            Console.WriteLine("Max: " + Max);
            Console.WriteLine("Min: " + Min);
            Console.WriteLine("Sum: " + sum);
            Console.WriteLine("Avg: " + avg);

        }
        static void Main(string[] args)
        {
            Array a = new Array(new int[] { 1, 2, 3, 4, 5 });
            a.calculate();
        }
    }
}
